============================== PicoGAME - Constructors Notes ===============================


** These notes are only applicable to the PROTOTYPE version of the board, which has no version number. **
** Check the list of Known Problems at the end of these notes. **


Specification
5V DC supply via 3.5mm/1.3mm barrel jack socket
5V DC output via USB-A socket
On-board 3V3 linear regulator
Load current was measured at 98mA at 5V while playing a WAV music file through headphones.
VGA output socket
PS/2 keyboard input socket
3.5mm Audio Jack socket
Two Controllers can be used, or one joystick. If a joystick is used on Port B then Port A can be used for a Controller, a Paddle/potentiometer or for simple networking.

Game port A DB9 socket:
		Controller_mode		Network_mode
1	n.c.
2	GP0	Data			COM1_TX
3	GP1	Latch			COM1_RX
4	GP2	Clock
5	n.c.
6	3V3	3V3
7	3V3
8	GND	GND			GND
9	GP28	(Optional paddle)

Game port B DB9 socket:
		Controller_mode		Joystick_mode
1	GP3	n.c.			UP
2	GP4	Data			DOWN
3	GP5	Latch			LEFT
4	GP22	Clock			RIGHT
5	GP26	(Optional paddle)	(Pad B / Pot Y)
6	GP14	3V3			Fire button (Trigger)
7	3V3				3V3
8	GND	GND			GND
9	GP27	(Optional paddle)	(Pad A / Pot X)

The 3V3 supply on Pin 7 of Port B is not short-circuit protected. Other 3V3 supply pins are current limited.
All joystick switch inputs are active-low..

Several variations of joysticks can be used:
Atari 800/VCS has switches, Pad A and Pad B. There is a single Fire button as above.
Atari ST is switched only. It has an additional button on pin 9
Commodore Amiga, Vic20, C64 & C128 have switches, Pot X (Button 2) & Pot Y (Button 3). Pin 6 is Button 1.

Do not use joysticks intended for the built-in ports on the Sinclair Spectrum +2, +2A or +3. These are wired differently and are incompatible.

JS1 is a low cost analogue "thumb" joystick module, widely available from many sources. It includes a "press to fire" switch. One of these with a couple of buttons could probably be fitted into a 90mm x 70mm x 28mm box to make a very nice little custom analogue controller, connected by a 6 or 8 way ribbon cable. A 9-way ribbon would allow the use of an IDC connector for the DB9 end. Unfortunately this joystick seems to be difficult to get without the 90 degree male headers already soldered. This makes it a little difficult to connect to the header on the PCB.

The Controllers use Data, Latch and Clock lines. They are similar to those used for the NES/Famicom but have DB9 plugs. They are obtainable from Aliexpress at very reasonable cost. You can also build your own as the components (if you use ordinary buttons) are inexpensive.



			=====================  Bill Of Materials   =======================

QTY	Description & Source

1	PicoGAME PCB
1	Hammond 1593WBK enclosure (optional) - Mouser 546-1593WBK, Digikey 164-1593WBK-ND, RS 228-7399
0	U1 - Not normally fitted. Link out as shown on PCB - Bitsbox M058 or equivalent
1	U2 - MCP1700 3V3 250mA voltage regulator - Bitsbox QD314
1	U3 - Raspberry Pi Pico with PicoMite VGA firmware and male pins on bottom
1	U4 - 4-way level shifting module - ebay
1	U5 - Micro SDcard module - ebay. Note, not the version with a regulator or level shifting

1	K1 - 3.5mm/1.3mm barrel jack connector - Mouser 490-PJ-031D, ebay
1	K2 - Upright USB-A PCB Socket Right Angle - Amphenol FCI 73725-0110BLF, RS 771-0048, Mouser 649-73725-0110BLF
	** See Known Problems **
1	K3 - 15-pin 3-row DB15F 90 degree VGA connector
	  RS 481-443, AMP 1-1734530-1, MULTICOMP SPC15430, Element14 1557991, Toby Electronics HL15S
1	K4 - PS/2 female socket - ebay - HA1607
1	K5 - 3.5mm jack socket - Pro Signal PSG03613 - ebay, CPC Farnell AV21208
2	K6, K7 - 9-pin DB9M 90 degree connector - TE Connectivity Amplimite 5747840-6, RS 446-5209, Toby Electronics 	DMR09P

1	D1 - SB140 or 1N5818. You can usually get away with a 1N4001 here. It will drop about 0.75V at 100mA.
	  Only the keyboard will be affected by the lower voltage.
2	D2, D3, D7, D8 - 1N4148 or 1N914
2	D4, D5 - BAT85 or similar small signal Schottky diode - Bitsbox QD113
1	D6 - Red/Green 3-wire common cathode 3mm LED. Note - this fits into a 3.5mm gap between the controller ports..

1	Q1 - BC327 or similar small signal PNP transistor - Bitsbox QD005

0	C1A - Not normally fitted
0	C1B - Not normally fitted
1	C2 - 220uF 10v 2.5mm pitch aluminium can electrolytic - Bitsbox HC220U10
1	C4 - 22uF 10v tantalum electrolytic - Bitsbox CT22U10A
2	C5, C6 - 47nF 100v polyester film - Bitsbox PY47N
6	C3, C7, C8, C9, C10, C11 - 100nF multilayer ceramic - Bitsbox CC004 (It's worth getting 10 just in case :) )

	All resistors can be 0.25W 5% carbon film. Metal film 0.25W 1% are preferable for the 220R value.
3	R1, R4, R32 - 1k
4	R2, R3, R5, R6 - 2k2
2	R7, R8 - 470R (These set the max. volume for headphones. Do not reduce below 270R)
1	R9 - 2R2
10	R10, R11, R12, R14, R15, R16,R17, R18, R33, R30 - 220R
1	R13 - 100R 6mm preset - Bitsbox V6R100R
11	R19, R22, R23, R24, R25, R26, R27, R28, R29, R31, R34 - 10k
1	R20 - 680R
1	R21 - 27k
1	R35, R36 - 68R
1	R37 - 120R

2	20-way female SIP connector for PicoMite

1	LB1 - 3x2 and 3x1 male link headers (or 1 3x3) ** See Known Problems **
1	LB2 - 3x2 male link header                     ** See Known Problems **
5	0.1" jumper to fit above - Bitsbox CN059       ** See Known Problems **
1	5-way female SIP connector for JS1 (optional)

1	Right-angle 6mm tactile switch - Bitsbox SW059
1	JS1 - Joystick module - ebay. Often found in Arduino sensor kits or advertised as a PS4 spare part. (Optional)


Notes:
* If you wish you can replace R37 and R13 with a single 200R multi-turn preset with in-line pins. There are marks on the PCB showing the corner locations of it. You can fit it either way round.
* Neither of the boards that I built have needed C4, but they have not had rigerous testing yet.
* U1, C1A and C1B  won't normally be used. The intended use is to install a 800mA 78xx-compatible switching regulator to provide the initial 5V supply. This would allow the board to be powered from anywhere between about 9V and 36V in a boat or caravan or somewhere off-grid like that. The 5V output comes after U1, so there is still a supply for a HDMI converter.


Preliminary assembly tests - nothing soldered yet.

Audio jack location pins don't line up - just cut them off. I couldn't find a proper drawing of this component and it's *very* hard to see black plastic against black plastic, never mind measure it, so it was half expected. The pins are fine.

The USB-A connector needs the big pins bending very slightly to bring them in line with the front & rear little pins. Once that is done it fits ok.

I tried 3mm MF spacers for the joystick module but they don't fit - I made the PCB holes 2.8mm for 2.5mm dia threads. Even so, the one closest to C8 may not work as it's probably too close to the SDcard.

A 3mm LED will just fit between the game controller sockets.

Holes for the male link headers are a shade too small. Some may fit, most not. You could hard wire or use female headers with plug-in wire links on this version. Something to fix for the next revision!




Constructional hints:
Fit the level shifter *before* the PS/2 and VGA sockets - you need room to work. You can either plug it into female headers or fully solder it. I chose the latter. If you are using the pins that come with it note that they are very hard to cut and will damage your best wire snips - use big chunky wire cutters or, and I speak from experience, they will lose the fight with a cutting disk in a Dremel. :) Alternatively, as there are only 8 connections, you can use bits of component leads, although it's a bit fiddly to do.

The pins on the SDcard module do really need to be soldered directly for rigidity. A plug-in connection isn't recommended here. I trimmed the pins down before soldering them - it was far easier than using the Dremel to take the excess off after.




Link blocks
LB1 has the middle row of pins connected to the analogue inputs via 10k resistors. It can be used in 3 ways:

With no link - the analogue pin is simply connected to the port. An input voltage is provided by a potentiometer between GND and 3V3. This is how JS1 works.
With the link in the lower position (UP) - the resistor is connected as a pull-up to 3V3. This allows the input to be used for an active-low button input. e.g. for joysticks that have multiple buttons like the Atari ST.
With the link in the upper position (DN) - the resistor is connected as a pull-down to GND. This is the usual connection when a "Paddle" is used. They have one end connected to 3V3 and the other to the analogue input.


LB2 sets the audio output level. H is Headphones/High and L is Line/Low. Each of the links controls its channel independently.




Commisioning
PicoGAME runs a normal version of the PicoMite VGA Edition firmware by Geoff Graham & Peter Mather.It is reommended that you download & install the latest version.

When setting up remember that the PicoMIte's 3V3 output is disabled so it depends on the 5V input to the PCB for power. You may need to connect the USB lead in addition to that supply if you need console access rather than VGA.The USB and external supplies are isolated from each other by diodes so no damage will occur.

Setup for the board should include the following to enable the hardware:
OPTION SDCARD GP13, GP11, GP12, GP10
OPTION AUDIO GP6, GP7

Ideally your program should have this at an early stage:
SETPIN GP15, DOUT
PIN(GP15) = 0
This will ensure that the port is set up in Controller mode.

To switch to Joystick mode you use PIN(GP15) = 1. This removes the 3V3 supply from pin 6, allowing it to be read using PIN(14). Note that the pin can actually be read in both modes, but in Controller mode the Fire button contact has to carry more current. At the moment this is approximately 33mA, but depending on future tests with a Controller it may be necessary to increase this, which may reduce the lifetime of some tactile switches.




Known Problems:
* I'm a little unhappy with the USB-A 5V output socket. It's very tight along there and the plug is hard up against the power plug. Still, it probably won't get used by many people. I can't juggle much more space as there are PCB mounting pillars in the way under the board.
* Polarity of the USB-A socket is wrong! There is an alternative version with the opposite polarity, but I'm intending to fix the PCB instead as some people may have some of these already - they are the ones used on the CMM2.In the meantime either don't fit the socket or do a bit of track modification to correct the polarity.
* The holes in the board for the link blocks LB1 & LB2 are too small. You will have to use female headers and wire links. I used the "snappable" sort intended to be used as IC sockets.
* Left and Right audio channels are reversed. You can get round this by crossing the links over on LB2. e.g. for headphones link the middle left to bottom right and middle right to bottom left.
* White adjustment trimmer makes very little, if any, difference on my setup. YMMV.
* For mechanical strength it's advisable to scrape away some of the solder resist so that the fixing clips of the VGA connector can be soldered to the board. Don't get too upset about this - with all 15 pins soldered there is quite a bit of strength and all you are really adding is some screening for the cable.
* I would recommend that you change the values of R7 and R8 to 470R if you are working from the original BOM. I found this to be a good compromise for my 32R headphones.
* Where component holes don't line up properly these will be corrected on the next revision.